package com.qfedu.food.service.impl;

import com.qfedu.food.dao.TBuyCourseDao;
import com.qfedu.food.pojo.TBuyCourse;
import com.qfedu.food.service.TBuyCourseService;
import com.qfedu.food.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @auther BUG小能手
 * @date 2021/1/11 21:17
 */
@Service
public class TBuyCourseServiceImpl implements TBuyCourseService {

    @Autowired
    private TBuyCourseDao tBuyCourseDao;

    @Override
    public R findAll() {
        return R.ok(tBuyCourseDao.selectAll());
    }



    @Override
    public void addCourse(TBuyCourse tBuyCourse) {
        if (tBuyCourse == null) {
            R.fail();
        }
        try {
            tBuyCourseDao.addCourse(tBuyCourse);
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }
    }


}
